package com.Core;

public class DatabaseSQL
{	//Table Creation SQL
	public static final String	createProfilesTable	=
		"create table PROFILES" +
		"(	Id			integer		primary key			autoincrement," +
		"	Score		integer," +
		"	Step		integer," +
		"	Coin		integer," +
		"	CurMapId	integer		references MAPS(Id)	on delete set NULL" +
		");";
	public static final String	createMapsTable		=
		"create table MAPS" +
		"(	Id		integer			primary key			autoincrement," +
		"	Name	text," +
		"	Data	text," +
		"	Goals	text," +
		"	Objects	text," +
		"	TypeId	integer			references MAPTYPES(Id) on delete set NULL," +
		"	MapLv	integer," +
		"	Status	integer," +
		"	CurData	text" +
		");";
	public static final String	createMapTypesTable	=
		"create table MAPTYPES" +
		"(	Id		integer			primary key," +
		"	Name	text" +
		");";
	//Profile manip SQL
	public static final String	createProfile		=
		"insert into PROFILES(Score,Step,Coin,CurMapId) values(%d,%d,%d,%d);";
	public static final String	getProfile			=
		"select Id,Score,Step,Coin,CurMapId from PROFILES limit 1;";
	//Map Types manip SQL
	public static final String	addMapType			=
		"insert into MAPTYPES(Id,Name) values(%d,'%s');";
	//Maps manip SQL
	public static final String	addMap				=
		"insert into MAPS(TypeId,MapLv,Name,Data,Objects,Goals,Status,CurData) values(%d,%d,'%s','%s','%s','%s',%d,'%s');";
	public static final String	getMapByID			=
		"select TypeId,MapLv,Name,Data,Objects,Goals,Status from MAPS where Id = %d";
	public static final String	getMapByTypeLv		=
		"select Id,Data from MAPS where TypeId = %d and MapLv = %d";
	public static final String	getAllMaps			=
		"select TypeId,MapLv,Name,Data,Objects,Goals,Status,Id from MAPS order by Id";
	public static final String	updateProfile		=
		"update PROFILES set Score=%d, CurMapId=%d where Id=%d;";
	public static final String	updateMaps			=
		"update MAPS set CurData='%s' where Id=%d;";
	public static final String	getInitMapData		=
		"select Data from MAPS where Id=%d;";
}
